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