UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h/4qxTL+9+8dtrhNLL/MTg4JEFm9T9hSeYmk2pCfMLI='
WHERE
key_id = '5e7857eea527bfdbae7530d099e46e825a6ba9007951a7b6e283c3bba1c0ff0d'
AND (
token = 'h/4qxTL+9+8dtrhNLL/MTg4JEFm9T9hSeYmk2pCfMLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)