UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hPEx6iUVEtg/xEiJK0FNUaDyo30yYf4/tDJbQ6AK5MY='
WHERE
key_id = '29d80ad6fdbf8a042dcd6c7eb0ecd161f4b88abdea76610a0e3e77faf314c6af'
AND (
token = 'hPEx6iUVEtg/xEiJK0FNUaDyo30yYf4/tDJbQ6AK5MY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)