UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QvQ/KDa49ecqc4+KLRGfvfMN3+xWh23W0U43Tf5neqs='
WHERE
key_id = 'e4bb7e66f3b5c2016e766f87de1af5f6014483c8d6e31b4ed5276d22cc59e4c0'
AND (
token = 'QvQ/KDa49ecqc4+KLRGfvfMN3+xWh23W0U43Tf5neqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)