UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'suklEKtv7tJsa0KeYzDD8duEDyuRk/U+sqopzxv7qVw=' 
WHERE 
  key_id = '9b3c5fb75956f3c0d6910cc4bd77f2978460d6ac9d3e9c5450e18462fc7f96a7' 
  AND (
    token = 'suklEKtv7tJsa0KeYzDD8duEDyuRk/U+sqopzxv7qVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021