UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ddZ5eaJalh3v1Vsg1jbfSsJj1Tv0HyXXZY7cvDyhXac='
WHERE
key_id = '33bf3ce74dc53c8b72c4b6c2419e06916b1820bc305b9a714a358198a09f68a2'
AND (
token = 'ddZ5eaJalh3v1Vsg1jbfSsJj1Tv0HyXXZY7cvDyhXac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)