UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JhzRXzS5H5Zao04UkfGGBdwE78q/9D21/Rk2Zhqjp+k='
WHERE
key_id = '503cab80c1805ab0508939b58ad919f30141591b013f03e71b189b4b5d282c74'
AND (
token = 'JhzRXzS5H5Zao04UkfGGBdwE78q/9D21/Rk2Zhqjp+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)