UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yGi9bUMfToK0qyT1kSUrCVboRkOh6hkFlZnNlQI4+vw='
WHERE
key_id = '67ef9fb2506d61f0bd874c2c285afa024fbdb2f09a6f6ef4a14e13fcc736d4ed'
AND (
token = 'yGi9bUMfToK0qyT1kSUrCVboRkOh6hkFlZnNlQI4+vw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)