UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'obkwoe7eXV711ig7ZHUmmmd3Fp/I7el97dXjkra95gA=' 
WHERE 
  key_id = '34ab9c77ffa8f2bcaa05203cfddb53d9703c0bece3e628ae1c056ab8050f1961' 
  AND (
    token = 'obkwoe7eXV711ig7ZHUmmmd3Fp/I7el97dXjkra95gA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020