UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+SP4MvW1FfYmfOYDlNPeO9M0EQvk1VslCpew8rdhUaY=' 
WHERE 
  key_id = '2821014d7fbd12bc0404ffed898d4089e9c0a621e07ef58157ba3a0509fe13c9' 
  AND (
    token = '+SP4MvW1FfYmfOYDlNPeO9M0EQvk1VslCpew8rdhUaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028