UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cTk5YVmDG/hKw1/whh2/c3asYXPG/uBOYo0EkyUple0=' 
WHERE 
  key_id = '52b84b2a6ebcf61bfa4bb177c31fc289baddacb249e5c72029ba1a9e02975303' 
  AND (
    token = 'cTk5YVmDG/hKw1/whh2/c3asYXPG/uBOYo0EkyUple0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032