UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cGBB5enmGl2Z0XUnBDIKmDj3XQVGQmTMGh6nJYiAG/g=' 
WHERE 
  key_id = '41823cf0c7fa2b5c0b95f21e09cb4d9217e44cc791d132c56147dd49e2ca0f3b' 
  AND (
    token = 'cGBB5enmGl2Z0XUnBDIKmDj3XQVGQmTMGh6nJYiAG/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018