UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TqRdQgdM6Jctzkgy04cYU0iWJP9ZhXf3batlgwYUIqM='
WHERE
key_id = 'e4555c871cc4551209fdf8d695106a05d0d945bc4e034e9ee2cf7fbb3e6762c2'
AND (
token = 'TqRdQgdM6Jctzkgy04cYU0iWJP9ZhXf3batlgwYUIqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)