UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4clO8Sy1dwKqap3bqulwG8k+81spwJ1QtLBC+WwmRHw='
WHERE
key_id = 'dec4da1941c7ceae1efecd2e196848200a78b0304392c71ddd632fa24fdaefbd'
AND (
token = '4clO8Sy1dwKqap3bqulwG8k+81spwJ1QtLBC+WwmRHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)