UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SMMaTeirJXKmSg8sc5yKikeWkFM6eBg1vDf9y3Kmpkg='
WHERE
key_id = '5e0658099b1d3984c3979482c42f2fe47ea737c7692a462d676a698eaaa86f8c'
AND (
token = 'SMMaTeirJXKmSg8sc5yKikeWkFM6eBg1vDf9y3Kmpkg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)