UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j2MwoalAeQMy4spYvRutWKCJiJteR8xLgIbNRfnrC8s='
WHERE
key_id = '8463c80f08fbe786e97adffb0f459351d7c2a363bd0ef5f8982e9e66afbf2c5b'
AND (
token = 'j2MwoalAeQMy4spYvRutWKCJiJteR8xLgIbNRfnrC8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)