UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zGsLIvE8eNZdjIOGwTEEnYtYTS/TH+XyP4X21kRfSL4='
WHERE
key_id = 'eec1f6ec7d78216462525ff253186967959997ea9a0db5ad5f54ca39d9d37d4f'
AND (
token = 'zGsLIvE8eNZdjIOGwTEEnYtYTS/TH+XyP4X21kRfSL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)