UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JVQRxUXcQVG1QCiwn065smTVdcTjihhqJk+raRf9SZ4='
WHERE
key_id = '21c34e6540dc1cd87b876640250a34abede0d1a75565fbcdb237fc7e3a76a0de'
AND (
token = 'JVQRxUXcQVG1QCiwn065smTVdcTjihhqJk+raRf9SZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)