UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2LiYfv1YL0aDozL01NR7LGhhpGsSWDuoJN6arULV4zQ='
WHERE
key_id = 'bd60d2025a34b93dbbd5554492a0c15b20e552e271c1992d29635aeac92cf873'
AND (
token = '2LiYfv1YL0aDozL01NR7LGhhpGsSWDuoJN6arULV4zQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)