UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MTkpI5BKvEJqgzqCNXgtSFCsSF2WC/6uJVnOoJbQeg8='
WHERE
key_id = '32fa9e06af639bdfe926bd399e84127f841d8fddf92ec217a0943f2e5cbcf502'
AND (
token = 'MTkpI5BKvEJqgzqCNXgtSFCsSF2WC/6uJVnOoJbQeg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)