UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PeILKZqyYGvnAdwCKYuta3fdNkWnTm1IdKv+2TINoPc='
WHERE
key_id = '08418b2609b60c30fd206bc3c9bc117662785c8d5c41e584fb11d9864097fdbd'
AND (
token = 'PeILKZqyYGvnAdwCKYuta3fdNkWnTm1IdKv+2TINoPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)