UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q+GAhQjp+Waw7mj84dTtFrlqGtPSoxqPk0fJnLBwohI='
WHERE
key_id = 'ec0c1993a512641b67a077d32a036bc99ba2880417d2463d84fc036fac67baea'
AND (
token = 'q+GAhQjp+Waw7mj84dTtFrlqGtPSoxqPk0fJnLBwohI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)