UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h/529dkujJzRz9ib9i4OES4XCak3aq6WouTbGv35Bfk='
WHERE
key_id = '900e44449a244462015f3e125bec22ba303ffe025db8ede7d5d37a277b13a628'
AND (
token = 'h/529dkujJzRz9ib9i4OES4XCak3aq6WouTbGv35Bfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)