UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NZELp3k/bk9yDUtKHDOoepgqwKIQrDpHEUXtQJMAkg0='
WHERE
key_id = 'f874646581144618b65b0c3bf292c91ed9d9f9c07b0d17cb6f983bad3b08ad67'
AND (
token = 'NZELp3k/bk9yDUtKHDOoepgqwKIQrDpHEUXtQJMAkg0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)