UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'snmbswK908zkcKhKqOrnnbGBTcVJTMp4U3VYhLcea+M=' 
WHERE 
  key_id = '5a2518ac2691ebd37f05baef814c32008dad26136abf4ceb950c2828f5c47178' 
  AND (
    token = 'snmbswK908zkcKhKqOrnnbGBTcVJTMp4U3VYhLcea+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030