UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5OIxH8pD2Bl8RZHWyQhKPC7SggfGZPuMC5a+w1V3VPg='
WHERE
key_id = '32d2e48c5917162f32b5b559186e604a88bfcd40f7468e31017a6e471d1286bb'
AND (
token = '5OIxH8pD2Bl8RZHWyQhKPC7SggfGZPuMC5a+w1V3VPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)