UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'es6fpyfLIhuux3Gv1rSaPp1tf7cQzufaEkjkvOvZQkE='
WHERE
key_id = '4dcd5073e5061d9ec3cf215b289cfd9931b41d88d6e79ab0380fc1dcd044d5c8'
AND (
token = 'es6fpyfLIhuux3Gv1rSaPp1tf7cQzufaEkjkvOvZQkE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)