UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TpZAbqtQemEVlp3HY03P07GuidEbBDP3Sy4Gdly3ZAw='
WHERE
key_id = '56cdbbe00cc2b1719fc370506e26b1208f54daeaa07fa0174c3b11b0040db42e'
AND (
token = 'TpZAbqtQemEVlp3HY03P07GuidEbBDP3Sy4Gdly3ZAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)