UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IX6URSlQeYJhQpromBKSkPaTxifk9XI4Bj3/sZkW7X8='
WHERE
key_id = '4d952258c3127adce26c6d6bcb17ca1332e2b7efa9ecc9fe2b9793d480798714'
AND (
token = 'IX6URSlQeYJhQpromBKSkPaTxifk9XI4Bj3/sZkW7X8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)