UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3vC1D0YWWNhkNmMMQTQ7WWeXGafly6V2p+CWSoxWAV4='
WHERE
key_id = '6c488fb2c70bec137fa63d4f5e2f5db82e1940d7dd95231eee0c9ea09a93bbe5'
AND (
token = '3vC1D0YWWNhkNmMMQTQ7WWeXGafly6V2p+CWSoxWAV4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)