UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nAnB9/fXs+ra5Um5/L0931BQjgkn2E+fVY2aj8fKMEg='
WHERE
key_id = '2171c2a94dae5e80e71a2e880bf325ab8106031d93a3fe4b26726ae0313ffe58'
AND (
token = 'nAnB9/fXs+ra5Um5/L0931BQjgkn2E+fVY2aj8fKMEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)