UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BuZfESJLVQFWxHXR9VrXKzWrKc9C3I9oTmDCLlY2AlY=' 
WHERE 
  key_id = '14c28f8b70a7e4b48f35e62fc7899159f991cb4cdc16200a4300c93e517adc58' 
  AND (
    token = 'BuZfESJLVQFWxHXR9VrXKzWrKc9C3I9oTmDCLlY2AlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020