UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EakETkptWnHAajH6Nyd1/pNRvGBNwACb6/HtoKWOjqQ='
WHERE
key_id = 'a3c49fd16977372a08d4292050e06237bd9708477be198fccfab0da97641ab11'
AND (
token = 'EakETkptWnHAajH6Nyd1/pNRvGBNwACb6/HtoKWOjqQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)