UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n4kPKQVTFxwS4s9y8Syn2LBn/t8QsOYVBspRZpf8OG0='
WHERE
key_id = '452ec1a195e25968d8373f50d7c14a0fa0db1bc499c1324fb54a993fc84a5e17'
AND (
token = 'n4kPKQVTFxwS4s9y8Syn2LBn/t8QsOYVBspRZpf8OG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)