UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '43OryhgG7/WqX4LbnfEVcTfwyveQ3I3MpB5bcQu6zeY=' 
WHERE 
  key_id = '705710d15cd8f9be46c11b25a4a5f20ee6c444649c7a6031c694727e1c75b530' 
  AND (
    token = '43OryhgG7/WqX4LbnfEVcTfwyveQ3I3MpB5bcQu6zeY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040