UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CEHD2KKbs83BywJK0lkHQcq1xlQ4zSiGLd1MN5oP6c0=' 
WHERE 
  key_id = 'f4452f378b9068a9005b024eb32b1ab5b5d7d5cc40522a8fd50c400fb5fa976b' 
  AND (
    token = 'CEHD2KKbs83BywJK0lkHQcq1xlQ4zSiGLd1MN5oP6c0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022