UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u7KzFDfB3xh61oGx9frq7UB+w55i7P/dVHkc/uwzi38='
WHERE
key_id = 'f2c0ac36766858300599fec24f768471fa694e582fbc4ea979d0694c4b3681a8'
AND (
token = 'u7KzFDfB3xh61oGx9frq7UB+w55i7P/dVHkc/uwzi38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)