UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZMdv3VQh+CfehNHr/KcxNzs7kS1R1gDjVNw6RNBIgUw=' 
WHERE 
  key_id = 'e80cb7df9468e6de717ca82df470588a3c01811ae3b6e97956ac6d02a07926b0' 
  AND (
    token = 'ZMdv3VQh+CfehNHr/KcxNzs7kS1R1gDjVNw6RNBIgUw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041