UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'huX/i0VxlMDeAaQH4Vhx09ZZ2N7uhksHgJ5EnSNhyG0='
WHERE
key_id = '37c4a755b3acf828df25783c0194d7f714d4d1878eb11c7758d438cbb0367fe7'
AND (
token = 'huX/i0VxlMDeAaQH4Vhx09ZZ2N7uhksHgJ5EnSNhyG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)