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