UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mOAH+Tw4NO89c3yAtQ96V7pS2HWtdwKOLNmFtn8oi64=' 
WHERE 
  key_id = '5f04950eae4429749108a8f7b845def112f4aea2baf7123830c5ede8cf64c734' 
  AND (
    token = 'mOAH+Tw4NO89c3yAtQ96V7pS2HWtdwKOLNmFtn8oi64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047