UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mrYlUGBdoH3gYqq+td7KbJq9IzVvJaqXXNcEt6iNRK8=' 
WHERE 
  key_id = '7abc02f6aa92856dadb4e5396897d3d5fb3fd929d9a86a177015cdfb45d3954d' 
  AND (
    token = 'mrYlUGBdoH3gYqq+td7KbJq9IzVvJaqXXNcEt6iNRK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033