UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4GJISxh97Vik8Nwzyw7WFHyFx9hzL/G3DBinOw6ny48=' 
WHERE 
  key_id = 'f91be1a4d45b4d1e1d0c6b8a74a893b52d52f844aa2e1c4bbfc4e2cfe2e189c1' 
  AND (
    token = '4GJISxh97Vik8Nwzyw7WFHyFx9hzL/G3DBinOw6ny48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036