UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jkSQghndDUk68VqDurLcfxOAvj7QSzxmgoD6/EqFjaI=' 
WHERE 
  key_id = '672e3437e0e2982ad29fe1aeef47c9ba01c0fec38388a89af020d3de8906f127' 
  AND (
    token = 'jkSQghndDUk68VqDurLcfxOAvj7QSzxmgoD6/EqFjaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025