UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7YtbFSBR9Acf3GluzzJ4p9DqvOhzhG39Vp5vTrZwmKM='
WHERE
key_id = 'c9df4d137ea674c2e055c0ff2490ebe3e674b341e7abc7455e74d3d871fd0ba4'
AND (
token = '7YtbFSBR9Acf3GluzzJ4p9DqvOhzhG39Vp5vTrZwmKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)