UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lM9qVKDd1MpFo7lAkJY8jIioqErd3DhjzunEYjbbRcQ=' 
WHERE 
  key_id = '67e92b14386b19c9c314a866b8de08c9f9d817dd3abfba4d47a09d77782aa840' 
  AND (
    token = 'lM9qVKDd1MpFo7lAkJY8jIioqErd3DhjzunEYjbbRcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00080