UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZuupE9n8wpHUTEyPRWV53iRz8x+O9E74gZgZOxCGaMc='
WHERE
key_id = '569b3a045e46e35ce2945c86f02487862acbd935279bdb189d011af9d086b017'
AND (
token = 'ZuupE9n8wpHUTEyPRWV53iRz8x+O9E74gZgZOxCGaMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)