UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cJDmJX+ilbfY9iFVn7WRU5bKpv9ALySq3FdFGSVH2MM='
WHERE
key_id = '8bcfb2af12d08d351b9485d957195dca3991eecfe5087affbb267b6708bddadb'
AND (
token = 'cJDmJX+ilbfY9iFVn7WRU5bKpv9ALySq3FdFGSVH2MM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)