UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fpu+y4Ebrl5biLMRT4UTMPDLDcN/SPs0VjVZm/wJ09I=' 
WHERE 
  key_id = 'cc67886a0e8a3c09da5d668ea448cc0373b19df0597e2dcbafd28c0a6d3b9a14' 
  AND (
    token = 'Fpu+y4Ebrl5biLMRT4UTMPDLDcN/SPs0VjVZm/wJ09I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024