UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2LP2nXQz2IWch6dRbIQNxMeM4Ce6dywjWwAYTx8w8og='
WHERE
key_id = '5629f041366d1ea775762ff65230a11bec5c786d6dc87674127b8065c3607943'
AND (
token = '2LP2nXQz2IWch6dRbIQNxMeM4Ce6dywjWwAYTx8w8og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)