UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5XSEuhL2iKdCHmUzhjp0wXjsEYB+M0GkYaVQGRZicSs='
WHERE
key_id = 'ac3ee615a50f6b7a9c020563f5d35db0b93e7f260589cbe8c1aec576fda6eec3'
AND (
token = '5XSEuhL2iKdCHmUzhjp0wXjsEYB+M0GkYaVQGRZicSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)