UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P5H7eMNbr6gCjDqMa57ASHUWfXjP0mmZ2QuSJrsGO3k=' 
WHERE 
  key_id = '6ce3bba4ba54d363e83b04c1586f395284815db40e170b071c9ea55477815d1b' 
  AND (
    token = 'P5H7eMNbr6gCjDqMa57ASHUWfXjP0mmZ2QuSJrsGO3k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031