UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vBqslUYIqnWRba1uBeupiXGBpggM9nb5QuBo25D2l5k=' 
WHERE 
  key_id = '60308752198757d23e607e0c06379633e6cb64fdd024faa908fdab5f5f0892f7' 
  AND (
    token = 'vBqslUYIqnWRba1uBeupiXGBpggM9nb5QuBo25D2l5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016