UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B9rKIThI1pmiPG3xyZe5D1EnSPZ7x+zvZgQqZiPX5vY=' 
WHERE 
  key_id = 'ddb42b4586ac39af522c9e6d8e6eac3037b9ef4e33dd8f772cf17b9f9fc4c9d6' 
  AND (
    token = 'B9rKIThI1pmiPG3xyZe5D1EnSPZ7x+zvZgQqZiPX5vY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048