UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BbA/dvpih40YprNXQurcNXojAc8CxOmutptJm78BG5Y=' 
WHERE 
  key_id = '0f4ccd1dc1488e2c2a10477a17ba44aa8e52d37cfffeefba37ad267169b59e2d' 
  AND (
    token = 'BbA/dvpih40YprNXQurcNXojAc8CxOmutptJm78BG5Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022