UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UTV7xh4cD9pDi2m7LbjnHVYRcJ90cezuMHCKYpYGnww='
WHERE
key_id = '21664c9dffc4c87918216b440bae551d7694922195e6657794fbd7fd0b50b531'
AND (
token = 'UTV7xh4cD9pDi2m7LbjnHVYRcJ90cezuMHCKYpYGnww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)