UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CQnM0AJphkxKLSLaHrLMokeKU+Tz2Bv2N+84C2QSxA8='
WHERE
key_id = '8b6f7dbe8350d88170cff621254d9d9c547be4172e5f7bde0b81423f4b6564d5'
AND (
token = 'CQnM0AJphkxKLSLaHrLMokeKU+Tz2Bv2N+84C2QSxA8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)