UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C1n0NQ57tOAE28mrtlIVyJqtSthNhPI3GZ06ywKorME='
WHERE
key_id = '36fa01ed4485ceae7752c2654a1339c6e59e7e0be8c9e11cd56eae9ddcf045e0'
AND (
token = 'C1n0NQ57tOAE28mrtlIVyJqtSthNhPI3GZ06ywKorME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)